package com.bj58.data.emailreports.sends;

import java.util.Date;
import java.util.List;

import com.bj58.data.emailreports.controllers.TopJianliReportController;
import com.bj58.data.emailreports.model.EmailReportUser;
import com.bj58.data.emailreports.utils.DateUtil;

public class JianLiTopSend extends BaseSend{

	public static void main(String[] args) {
		JianLiTopSend  jlTop = new JianLiTopSend();
		TopJianliReportController  jlTopController = new TopJianliReportController();
		String searchDate="";
		try {
			searchDate = DateUtil.getStringDate(DateUtil.getDateBefore(new Date(), 1),"yyyy-MM-dd");//查询日期（昨）
			if(null != args && args.length > 0){
				if(args.length != 1){
					System.out.println("params error");
					System.exit(0);
				}
				if(args[0].contains("-")){
					searchDate =args[0].trim();
				}
			}
			System.out.println(searchDate);
			
			List<EmailReportUser> userListCpc = jlTop.getUsersBySendType(47);
			String contextCpc = jlTopController.topjianliReport(searchDate);
			if("".equals(contextCpc)){
				jlTop.errorWarn("【报错】简历置顶日报！");
			}else{
				jlTop.ReportSend(userListCpc, "简历置顶日报"+ searchDate, contextCpc, null);
			}
			
		} catch (Exception e) {
			e.printStackTrace();
			jlTop.errorWarn("【报错】简历置顶日报"+searchDate);
		}
	}

}
